package com.zx.rbac.common.util;
import com.zx.rbac.common.util.MD5UtilQ;


public class TokenUtil {

    /**
     * 生成MD5加密的token
     * @param userId
     * @return
     */
    public static String createToken(Long userId){
        if(userId==null){
            throw new RuntimeException();
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(String.valueOf(System.currentTimeMillis()))
                .append(userId);
        String token = MD5UtilQ.generate(stringBuffer.toString());
        return token;
    }

}
